<template>
  <div class="header">
    <!--收缩菜单栏图标变化-->
    <span @click="toggle">
    <el-icon-expand v-if="collapse"></el-icon-expand>
    <el-icon-fold v-else></el-icon-fold>
  </span>
  </div>
</template>

<script lang='ts' setup>
let props = defineProps<{
  collapse: boolean
}>()

//分发事件
let emits = defineEmits(['update:collapse'])
let toggle = () => {
  //修改父组件数据
  emits('update:collapse', !props.collapse)
}
</script>

<style lang='scss' scoped>
.header{
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
}
</style>
